

//
//  ImageViewCell.m
//  BusinessMarket
//
//  Created by Michael Li on 2018/11/22.
//  Copyright © 2018年 Michael Li. All rights reserved.
//

#import "ImageViewCell.h"
#import "MessageModel.h"
#import "ServiceModel.h"
@interface ImageViewCell()

@end
static NSString *identifier = @"ImageViewCell";
@implementation ImageViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setMsgModel:(MessageModel *)msgModel
{
    if (msgModel.icon.length >0) {
        [self.iv sd_setImageWithURL:[NSURL URLWithString:msgModel.icon] placeholderImage:[UIImage imageNamed:@"noDataImg"]];
    }else {
        self.iv.image = [UIImage imageNamed:@"noDataImg"];
    }
    
}
+(instancetype)cellNibWithTableView:(UITableView *)tableView
{
    ImageViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        [tableView registerNib:[UINib nibWithNibName:@"ImageViewCell" bundle:nil] forCellReuseIdentifier:identifier];
        cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
-(void)setServiceModel:(ServiceModel *)serviceModel
{
    _serviceModel = serviceModel;
    NSArray *temp = [serviceModel.images componentsSeparatedByString:@","];
//    [self.iv sd_setImageWithURL:[NSURL URLWithString:temp[0]] placeholderImage:[UIImage imageNamed:@"noDataImg"]];

}

@end
